#include "hr_time.h"
#include <iostream>
#include <string>
#include <Windows.h>


#pragma once
using namespace std;


bool is_pal(int start, int end, string str)
{
	if (start >= end)
		return true;
	if (str[start] != str[end])
		return false;
	return is_pal(++start, --end, str);
}

void main(){

	SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
	SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);

	CStopWatch w;

	string word;
	int fr = 0;
	int ba;

	cout << "Write susspected palindrome = ";
	cin >> word;

	w.startTimer();

	ba = word.size()-1;

	if (is_pal(fr, ba, word) == true)
		cout << "It is a palindrome!" << endl;
	else
		cout << "No, try again.." << endl;
	w.stopTimer();

	cout << "Time =" << w.getElapsedTime() * 1000 << "ms" << endl;

 system("pause");



}
